#ifndef TOKEN_H
#define TOKEN_H

#include "../Symboltable/SharedPointer.h"

class IInformation;

enum TokenType {
	NONE,
	SKIP,

	// Types which go into hash table
	IDENTIFIER,

	// reserved words
	RESERVED_WORD,
	INT_TYPE,
	IF_TYPE,
	ELSE_TYPE,
	WHILE_TYPE,
	READ_TYPE,
	PRINT_TYPE,

	INTEGER,
	COMMENT,

	// Types without information
	SIGN,
	SIGN_PLUS,
	SIGN_MINUS,
	SIGN_DIV,
	SIGN_MULTI,

	SIGN_SMALLER,
	SIGN_GREATER,
	SIGN_EQUAL,

	SIGN_ASSIGN,

	SIGN_NOT,
	SIGN_AND,

	SIGN_SEMICOLON,

	SIGN_OPENPAREN,
	SIGN_CLOSEPAREN,
	SIGN_OPENBRACKET,
	SIGN_CLOSEBRACKET,
	SIGN_OPENBRACE,
	SIGN_CLOSEBRACE,

	ERROR,
	END_OF_FILE
};

class Token  {
private:
	TokenType type;
	size_t line;
	size_t column;
	SharedPointer<IInformation> information;

	void cleanUp();

public:
	Token(TokenType newType, size_t newLine, size_t newColumn, SharedPointer<IInformation> newInfo);
	void setInformation(const SharedPointer<IInformation> newInformation);
	IInformation* getInformation();
	void setType(const TokenType newType);
	TokenType getType();
	void setLine(const size_t newLine);
	size_t getLine();
	void setColumn(const size_t newColumn);
	size_t getColumn();
	char* getLexem();
	int getValue();
};

#endif
